package com.xiaobai.demo;

import lombok.extern.slf4j.Slf4j;

@Slf4j
public class ThreadTimeWaiting {
    public static void main(String[] args) {
        Thread t1 = new Thread(() -> {
            try {
                Thread.sleep(2000);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
        }, "t1");
        t1.start();
        log.info("t1 status is {}",t1.getState());
        try {
            Thread.sleep(500);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
        log.info("t1 status is {}",t1.getState());
    }
}
